package com.greenline.push.core.enums;

/**
 * 
 * @Type Tasks
 * @Desc 类型type和数据库task_sync 的type字段 一一对应
 * @author shuai.zuo
 * @date 2014年11月27日
 * @Version V1.0
 */
public enum Tasks {
    FETCH_SYNC(1), FETCH_ASYNC_REALTIME(2), FETCH_ASYNC_FIXEDTIME(3), FETCH_RETRY_WEIXIN(4), FETCH_RETRY_APNS(5), FETCH_RETRY_SMS(6), FETCH_RETRY_ECHAT(
            7), FETCH_RETRY_EMAIL(8), FETCH_RETRY_WEIXIN_FULL(9), FETCH_RETRY_APNS_FULL(10), FETCH_RETRY_SMS_FULL(11), FETCH_RETRY_ECHAT_FULL(
            12), FETCH_RETRY_EMAIL_FULL(13), FETCH_FULL_TO_RETRY(14), FETCH_RETRY_XMPP(15), FETCH_RETRY_XMPP_FULL(16), FETCH_UPLOAD_TO_RETRY(
            17),FETCH_FILTER_TO_RETRY(18),FETCH_RETRY_QQ_FULL(19), FETCH_RETRY_QQ(20);
    private Integer type;

    public static Tasks getTasksbyType(Integer type) {
        for (Tasks task : Tasks.values()) {
            if (task.getType() == type) {
                return task;
            }
        }
        return null;
    }

    private Tasks(Integer type) {
        this.type = type;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

}
